@extends('front.common.header')

@section('title',$result->title.' - 就业指南')

@section('head')
@parent
@stop

@section('content')
<link href="{{ asset('/css/employ/list.css') }}" rel="stylesheet" type="text/css">
<link href="{{ asset('/css/employ/moban2.css') }}" rel="stylesheet" type="text/css">
<link href="{{ asset('/css/company/jobs.css') }}" rel="stylesheet" type="text/css">
<link href="{{ asset('/css/company/comdetails.css') }}" rel="stylesheet" type="text/css">
<div class="main" >
    <div class="content" >
        <div class='top-nav'>
    		<ul>
    			{!! $mianbaoxie !!}
    		</ul>
    	</div>
    </div>
     <div class="employ-list" style="position: relative;">
        <div class="employ-list-left fl">
            <div class="employ-search mb20">
                <div class="employ-info employ-title mt-20">
                    {{$result->title}}
                </div>
                <div class="employ-info">
                    <div class="employ-info-ext fl">
                        <div class="user-info-avatar fl">
                            <img src=" {{ asset('/images/front/jiuyezhinan/pic1.png') }}" >
                        </div>
                        <div class="user-info-uname ml-20 fl">{{$result->user->name}}</div>
                        <div class="user-info-uname ml-20 fl">发表于{{$result->created_at}}</div>
                        <div class="user-info-createtime ml-10 fl">|</div>
                        <div class="dropdown user-info-createtime ml-10 fl">
                            <form action="{{url('/reports')}}" method="POST" onsubmit="return checkParam('{{empty($authuser)?0:1}}',this)">
                                {{csrf_field()}}
                                <input type="hidden" name="app" value="employ">
                                <input type="hidden" name="app_id" value="{{$result->id}}">
                                <input type="hidden" name="app_url" value="{{Request::getRequestUri()}}">
                                <input type="hidden" name="report_type" value="1">
                                <a href="javascript:void(0)" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> 举报<span class="caret"></span></a>
                                <ul class="dropdown-menu" aria-labelledby="dLabel">
                                    <li><button type="submit">个人信息举报</button></li>
                                    <li><button type="submit" onclick="$('input[name=report_type]').val(2);">垃圾信息举报</button></li>
                                </ul>
                            </form>
                        </div>
                        <div class="clearfix"></div>
                    </div>
                    <div class="employ-info-ext fl">
                        <ul>
                            <li class="color-orange">
                                <img src="{{ asset('/images/front/jiuyezhinan/view.png') }}" title="浏览">
    							{{ count($result->exts)>0 ?$result->exts->reading_num+1 : 0}}
    						</li>
                            <li class="color-orange">
                                <img src="{{ asset('/images/front/jiuyezhinan/pl.png') }}" title="评论">
    							{{ count($result->exts)>0?$result->exts->comment_num:0}}
    						</li>
    						@if(empty($result->is_collect) || $result->is_collect == 0)
                            <li class="color-gray" id="collect_num">
                                <a onclick="toCollect('/member/collect','employ','{{$result->id}}','{{ csrf_token()}}','{{empty($authuser)?0:$authuser->id}}')">
                                    <img src="{{ asset('/images/front/heart-no.png') }}" title="收藏" >&nbsp;&nbsp;
                                </a>
                                    <span class="color-gray">{{ count($result->exts)>0?$result->exts->recommond_num:0}}</span>
                                
                            </li>
                            @else
                            <li class="color-gray" id="collect_num">
                                <img src="{{ asset('/images/front/jiuyezhinan/red-heart.png') }}" title="收藏">&nbsp;&nbsp;
                                <span>{{ count($result->exts)>0?$result->exts->recommond_num:0}}</span>
                            </li>
                            @endif
                            <li class="small">|</li>
                            <div class="bdsharebuttonbox"><a href="#" class="bds_qzone" data-cmd="qzone" title="分享到QQ空间"></a><a href="#" class="bds_tsina" data-cmd="tsina" title="分享到新浪微博"></a><a href="#" class="bds_weixin" data-cmd="weixin" title="分享到微信"></a><a href="#" class="bds_douban" data-cmd="douban" title="分享到豆瓣网"></a></div>
                            <script>window._bd_share_config={"common":{"bdSnsKey":{},"bdText":"","bdMini":"2","bdMiniList":["qzone","tsina","weixin","douban"],"bdPic":"","bdStyle":"1","bdSize":"24"},"share":{}};with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion='+~(-new Date()/36e5)];</script>
                            <div class="clearfix"></div>
                        </ul>
                    </div>
                    <div class="clearfix"></div>
                </div>
                <div class="employ-info text-left">
                    <div id="engineer_info_box">
                        <div id="engineer_info">
                            <ul>
                                @foreach($result->content as $key=>$rescon)

                                <li class="center">
                                    <span class="tit"><a name="" id=""></a>{{$rescon['title']}}</span>
                                    <span class="icon @if($key==0) cur @endif"></span>
                                    <span class="content">
                                        {!! $rescon['content'] !!}
                                    </span>
                                </li>
                                @endforeach
                            </ul>        
                        </div>
                        <div id="Jump_btn">
                            <div>
                                <span class="Jump_up"><a onclick="return false;" href=""></a></span>
                                <span class="Jump_down"><a onclick="return false;" href="#01"></a></span>
                                <span class="Jump_top"><a onclick="return false;" href="#00"></a></span>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="employ-info">
                    <div class="nice-point">
                        <a href="javacript:void(0)" onclick="toApprove('/approve','employ','{{$result->id}}','{{ csrf_token()}}')"><img src="{{ asset('/images/front/jiuyezhinan/good.png') }}"></a>
                        <div class="nice-point-count" id="nice-point-count">{{count($result->exts)>0?$result->exts->approving_num:0}}</div>
                    </div>
                </div>
            </div>
            @if($result->exam_id > 0 && count($result->examination)>0)
            <div id="jobs-exam">
                <h4 class="c0 pt15 pb15 pl20 ma0">考试</h4>
                <div id="jobs-exam-main" class="row show-grid">
                    <div class="col-xs-10 col-sm-10 col-md-10">
                        <p class="ma lh38 fs16 c6">请参与应聘考试,以便更好的对您进行评估。</p>
                    </div>
                    <div class="col-xs-2 col-sm-2 col-md-2">
                        <div class="employ-exam-link" id="goExam">
                            @if($isToDelivery == 1)
                            <a href="javascript:void(0);">已通过考试</a>
                            @elseif($isToDelivery == 2)
                            <a href="javascript:void(0);" onclick="toExaminations({{ empty($authuser)?0:$authuser->id }})">重新考试</a>
                            @else
                            <a href="javascript:void(0);" onclick="toExaminations({{ empty($authuser)?0:$authuser->id }})">开始考试</a>
                            @endif
                        </div>
                    </div>
                </div>
            </div>
            @if(count($result->examination)>0 && ($isToDelivery != 1))
            @include('front.common.exam')
            @endif
            @endif
            <div id="com-comments-list">
                <h4 class="c0 pt15 pb15 pl20 ma0">全部评论</h4>
                <div id="itemContainer" >
                    @foreach($comments as $k=>$vo)
                    <div class="comment-common" id="comment-common{{$k}}">
                        <div class="comment-user-avatar fl pt10">
                            <img src="{{userlogo($vo->user_id,'middle')}}">
                        </div>
                        <div class="comment-main fl">
                            <div class="comment-content text-left">
                                <p class="font-20 c3">{{getUserName($vo->user_id)}}</p>
                                <p class="fs14 c5">{{$vo->content}}</p>
                                <div class="fs14 c9 ma0">
                                    <div class="fl">
                                        {{$vo->created_at}}&nbsp;&nbsp;&nbsp;&nbsp;
                                        <a href="javascript:;" onclick="showreply({{$vo->comment_id}})">回复</a>
                                    </div>
                                    <div class="fr mr15">
                                        <img src="{{ asset('/images/front/jiuyezhinan/pl.png') }}">
                                        @if(count($vo->childComments)>0)
                                        <input type="text" name="totalnum{{$vo->comment_id}}" value="{{count($vo->childComments)}}" readonly="readonly">
                                        @else
                                        <input type="text" name="totalnum{{$vo->comment_id}}" value="0" readonly="readonly">
                                        @endif
                                    </div>
                                    <div class="clr"></div>
                                </div>
                            </div>
                            <div id="comment-reply{{$vo->comment_id}}" class="comment-reply-form mt20 dn">
                                <div class="comment-reply-form-b">
                                    <textarea id="comment-reply-content{{$vo->comment_id}}" class="fl" placeholder="人可以走,留下你的态度"></textarea>
                                    <button type="button" id="submit{{$vo->comment_id}}" class="fr" @if(empty($authuser))onclick="loginTips()" @else onclick="pushComment('/comment/push?typeid=3','{{$vo->comment_id}}','{{$vo->user_id}}','0','{{$result->id}}','{{ csrf_token() }}')" @endif>发表回复</button>
                                </div>
                            </div>
                            <div id="message{{$vo->comment_id}}" class="commentmsg dn"></div>
                            <div class="comment-child text-left" id="comment-childs{{$vo->comment_id}}">
                                @if(count($vo->childComments)>0)
                                <div class="comment-caret-up"><i class="glyphicon glyphicon-triangle-top"></i></div>
                                <div class="comment-child-content" id="comment-child-content{{$vo->comment_id}}">
                                    @foreach($vo->childComments as $key=>$zn)
                                    @if($key<3)
                                    <div class="comment-child-content-list" >
                                        <p class="fs18 color-green">{{getUserName($zn->user_id)}}：</p>
                                        <p class="fs14 c5">{{$zn->content}}</p>
                                    </div>
                                    @endif
                                    @endforeach
                                </div>
                                @endif
                            </div>
                        </div>
                        <div class="clr"></div>
                    </div>
                    @endforeach
                </div>
                {{-- 分页 --}}
                <div id="holder" @if(count($comments)== 0) class="holder dn" @else class="holder" @endif></div>
                <script>
                  jPages();
                </script>
                <div class="comment-reply-main">
                  <textarea id="comment-reply-content" placeholder="人可以走,留下你的态度"></textarea>
                  <div class="mb20 lh44 mt10">
                    <div id="message" class="fl"></div>
                    <button type="button" class="fr" id="submit-main" @if(empty($authuser))onclick="loginTips()" @else onclick="comment('/comment/push?typeid=3','0','{{$result->id}}','3','{{ csrf_token() }}')" @endif>发表回复</button>
                  </div>
                </div>
            </div>
        </div>
         <div id="test" style="position:absolute; width: 234px; right: 0;" >
             <div class="employ-list-right fl" @if(empty($employSet)) style="display: none; " @else style="margin-bottom: 1em;" @endif >
                 <div class="employ-list-tips">
                     <div class="tips-title">系列导航</div>
                     @foreach($employSet as $k=>$emphots)
                         <div class="tips-content @if($k>0) bodertop @endif">
                             <div class="tips-content-main">
                                 <div class="tips-content-title"><a href="{{url('/employ/'.$emphots->id)}}">{{str_limit($emphots->title,24)}}</a></div>
                                 <div class="tips-content-views">阅读（ {{ $emphots->exts->reading_num }} ）</div>
                             </div>
                         </div>
                     @endforeach
                 </div>
                 @foreach ($ads_img as $key => $adimg)
                     <div class="employ-list-tips mt-10">
                         <img src="{{$adimg->attachment($adimg->id)->url}}">
                     </div>
                 @endforeach
             </div>
            <div class="employ-list-right fl"  @if(!empty($employSet->toArray())) style="display:none;"  @endif>
                <div class="employ-list-tips">
                   <div class="tips-title">人气热点</div>
                   @foreach($hots_employ as $k=>$emphots)
                   <div class="tips-content @if($k>0) bodertop @endif">
                       <div class="tips-content-main">
                           <div class="tips-content-title"><a href="{{url('/employ/'.$emphots->id)}}">{{str_limit($emphots->title,24)}}</a></div>
                           <div class="tips-content-views">阅读（ {{ $emphots->exts->reading_num }} ）</div>
                       </div>
                   </div>
                   @endforeach
               </div>
               @foreach ($ads_img as $key => $adimg)
               <div class="employ-list-tips mt-10">
                   <img src="{{$adimg->attachment($adimg->id)->url}}">
               </div>
               @endforeach
            </div>
         </div>
         <div class="clearfix"></div>
    </div>
</div>
<script>
    //右边固定位置
    $(window).scroll(function(){
       var top=$(document).scrollTop();
        if (parseInt(top)<250){
            top=0+'px';
        } else {
            top=$(document).scrollTop()-160+'px';
        }
        $('#test').animate({top:top},10,'swing');
    });
$(function(){
	var topHArr = [];
	$("#engineer_info ul li.center").each(function(){
		var a = $(this).position().top;
		topHArr[$(this).index()] = a;
		$(this).find(".tit").find("a").attr("name","#0"+$(this).index());
		$(this).find(".tit").find("a").attr("id","#0"+$(this).index());
	});
	var allEle = $("#engineer_info ul li.center");
	var liNum = allEle.length;
	var i = 0;
	$(".Jump_down").click(function(){
		
		if(i < liNum - 1 && i >=0){
			i = i+1;
			var topH = topHArr[i];
			$("#Jump_btn").css("top",topH+"px");
			$(this).find("a").attr("href","#0"+i);
			$(".Jump_up").find("a").attr("href","#0"+(i-1));
			$("#engineer_info ul li.center").find(".icon").removeClass("cur");
			$("#engineer_info ul li.center").eq(i).find(".icon").addClass("cur");
			var windowTop = $('a[name="#0' + i + '"]').offset().top - 180;
            $('body,html').animate({scrollTop: windowTop}, 'fast');   
		} else if(i>liNum) {
			i = liNum;
		} else if(i < 0){
			i = 0;
		};
		
	});
	
	$(".Jump_up").click(function(){
		
		if(i >= 1){
			i = i-1;
			var topH = topHArr[i];
			$("#Jump_btn").css("top",topH+"px");
			$("#engineer_info ul li.center").find(".icon").removeClass("cur");
			$("#engineer_info ul li.center").eq(i).find(".icon").addClass("cur");	
			$(this).find("a").attr("href","#0"+i);
			$(".Jump_down").find("a").attr("href","#0"+(i+1));
			var windowTop = $('a[name="#0' + i + '"]').offset().top - 180;
            $('body,html').animate({scrollTop: windowTop}, 'fast'); 
		} else {
			i = 0;
		}
	});
	
	$(".Jump_top").click(function(){	
		$("#Jump_btn").css("top","0px");
		i = 0;	
		$("#engineer_info ul li.center").find(".icon").removeClass("cur");
		$("#engineer_info ul li.center").eq(0).find(".icon").addClass("cur");	
		var windowTop = $('a[name="#0' + i + '"]').offset().top - 180;
        $('body,html').animate({scrollTop: windowTop}, 'fast');	
	});
// 	if(liNum > 0  && isclick== false ){
// 		$(window).scroll(function () {
//             for (var j=0; j<=liNum-1; j++) {
//                 if ($(this).scrollTop() >=allEle.eq(j).offset().top - allEle.eq(j).height()) {
//                     $("#engineer_info ul li.center").find(".icon").removeClass("cur");
//         			$("#engineer_info ul li.center").eq(j).find(".icon").addClass("cur");
//         			var topH = topHArr[j];
//         			$("#Jump_btn").css("top",topH+"px");
//         			$(".Jump_down").find("a").attr("href","#0"+(j+1));
//         			$(".Jump_up").find("a").attr("href","#0"+(j));
//                     return false;
//                 }
//             }
//         });
// 	}
});
</script>
@stop

<!--底部导航-->
@section('footer')
@parent
@stop